<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>highlight.lhs</title>
<meta name="generator" content="KF5::SyntaxHighlighting (Literate Haskell)"/>
</head><body style="color:#1f1c1b"><pre>
test file for Haskell syntax highlighting in KDE's Kate

The test file for literate Haskell can be easily created like this:
 cat highlight.hs | sed -e &quot;s|^|&gt; |&quot; -e &quot;s|&gt; -- ||&quot; -e &quot;s|^&gt; $||&quot; &gt; highlight.lhs
You only have to manually edit the multi-line comment below.

this is a single-line comment

{- this is a multi-line comment

Things like &quot;a string&quot; or a 'c' character shouldn't be highlighted in here.

I could even start a new
one-line comment.

-}

a data definition

<span style="color:#006e28;">&gt;</span> <span style="font-weight:bold;">data</span> <span style="color:#0057ae;">Tree</span> a <span style="color:#006e28;">=</span> <span style="color:#0057ae;">Br</span> (<span style="color:#0057ae;">Tree</span> a) (<span style="color:#0057ae;">Tree</span> a) | <span style="color:#0057ae;">Leaf</span> a | <span style="color:#0057ae;">Nil</span> <span style="font-weight:bold;">deriving</span> (<span style="color:#0057ae;">Show</span>, <span style="color:#0057ae;">Eq</span>)


function definition, &quot;funnyfunction::&quot;, &quot;Integer&quot;, &quot;Int&quot;, &quot;Bool&quot; should be highlighted

<span style="color:#006e28;">&gt;</span><span style="color:#006e28;"> funnyfunction</span><span style="color:#006e28;">::</span>(<span style="color:#0057ae;">Tree</span> a)<span style="color:#006e28;">=&gt;</span>[a]<span style="color:#006e28;">-&gt;</span><span style="color:#0057ae;">Integer</span><span style="color:#006e28;">-&gt;</span><span style="color:#0057ae;">Int</span><span style="color:#006e28;">-&gt;</span><span style="color:#0057ae;">Bool</span>


strings and chars
first line of function definitions (type declaration) should be highlighted

<span style="color:#006e28;">&gt;</span><span style="color:#006e28;"> strangefunction</span><span style="color:#006e28;">::</span><span style="color:#0057ae;">Int</span><span style="color:#006e28;">-&gt;</span><span style="color:#0057ae;">String</span>
<span style="color:#006e28;">&gt;</span> strangefunction <span style="color:#b08000;">1</span> <span style="color:#006e28;">=</span> <span style="color:#bf0303;">&quot;hello&quot;</span>
<span style="color:#006e28;">&gt;</span> strangefunction <span style="color:#b08000;">2</span> <span style="color:#006e28;">=</span> <span style="color:#bf0303;">&quot;what's up&quot;</span>
<span style="color:#006e28;">&gt;</span> strangefunction <span style="color:#b08000;">3</span> <span style="color:#006e28;">=</span> (strangefunction <span style="color:#b08000;">1</span>) ++ <span style="color:#bf0303;">&quot;, &quot;</span> ++ (strangefunction <span style="color:#b08000;">2</span>)
<span style="color:#006e28;">&gt;</span> strangefunction <span style="color:#b08000;">4</span> <span style="color:#006e28;">=</span> <span style="color:#924c9d;">'a'</span>:<span style="color:#924c9d;">'b'</span>:<span style="color:#924c9d;">'c'</span>:<span style="color:#924c9d;">'&quot;'</span>:[] <span style="color:#898887;">-- will return &quot;abc&quot;</span>
<span style="color:#006e28;">&gt;</span> strangefunction <span style="color:#b08000;">5</span> <span style="color:#006e28;">=</span> <span style="color:#924c9d;">'\n'</span>:[]
<span style="color:#006e28;">&gt;</span> strangefunction <span style="color:#b08000;">6</span> <span style="color:#006e28;">=</span> <span style="color:#924c9d;">'\invalidhaskell'</span>:[]

function name including the single quote character
and infix operator (`div`)

<span style="color:#006e28;">&gt;</span><span style="color:#006e28;"> justtesting'</span><span style="color:#006e28;">::</span><span style="color:#0057ae;">Int</span><span style="color:#006e28;">-&gt;</span><span style="color:#0057ae;">Int</span>
<span style="color:#006e28;">&gt;</span> justtesting' <span style="color:#b08000;">2</span> <span style="color:#006e28;">=</span> <span style="color:#b08000;">2</span>+<span style="color:#b08000;">1</span>
<span style="color:#006e28;">&gt;</span> justtesting' <span style="color:#b08000;">9</span> <span style="color:#006e28;">=</span> <span style="color:#b08000;">7</span> <span style="color:#006e28;">`div`</span> <span style="color:#b08000;">2</span>

same definition as above, slightly different function name and a couple more whitespaces

<span style="color:#006e28;">&gt;</span><span style="color:#006e28;"> justtesting''	</span><span style="color:#006e28;">::</span>	<span style="color:#0057ae;">Int</span> <span style="color:#006e28;">-&gt;</span> <span style="color:#0057ae;">Int</span>
<span style="color:#006e28;">&gt;</span> justtesting''   <span style="color:#b08000;">2</span> <span style="color:#006e28;">=</span> <span style="color:#b08000;">3</span>
<span style="color:#006e28;">&gt;</span> justtesting''	<span style="color:#b08000;">9</span>	<span style="color:#006e28;">=</span>   <span style="color:#b08000;">3</span> + <span style="color:#b08000;">9</span> - <span style="color:#b08000;">9</span>

the following lines are copied out of Haskell's &quot;Prelude.hs&quot;

<span style="color:#006e28;">&gt;</span> <span style="font-weight:bold;">infixl</span> <span style="color:#b08000;">7</span>  *, /, <span style="color:#006e28;">`quot`</span>, <span style="color:#006e28;">`rem`</span>, <span style="color:#006e28;">`div`</span>, <span style="color:#006e28;">`mod`</span>, :%, %


everything highlighted except the &quot;a&quot;

<span style="color:#006e28;">&gt;</span> <span style="font-weight:bold;">class</span> <span style="color:#0057ae;">Bounded</span> a <span style="font-weight:bold;">where</span>
<span style="color:#006e28;">&gt;</span>     <span style="color:#644a9b;">minBound</span>,<span style="color:#006e28;"> maxBound </span><span style="color:#006e28;">::</span> a

<span style="color:#006e28;">&gt;</span> <span style="font-weight:bold;">class</span> (<span style="color:#0057ae;">Num</span> a, <span style="color:#0057ae;">Ord</span> a) <span style="color:#006e28;">=&gt;</span> <span style="color:#0057ae;">Real</span> a <span style="font-weight:bold;">where</span>
<span style="color:#006e28;">&gt;</span><span style="color:#006e28;">     toRational     </span><span style="color:#006e28;">::</span> a <span style="color:#006e28;">-&gt;</span> <span style="color:#0057ae;">Rational</span>

finally, some keyword lists

keywords

<span style="color:#006e28;">&gt;</span> <span style="font-weight:bold;">case</span>, <span style="font-weight:bold;">class</span>, <span style="font-weight:bold;">data</span>, <span style="font-weight:bold;">deriving</span>, <span style="font-weight:bold;">do</span>, <span style="font-weight:bold;">else</span>, <span style="font-weight:bold;">if</span>, <span style="font-weight:bold;">in</span>, <span style="font-weight:bold;">infixl</span>, <span style="font-weight:bold;">infixr</span>, <span style="font-weight:bold;">instance</span>, <span style="font-weight:bold;">let</span>, <span style="font-weight:bold;">module</span>, <span style="font-weight:bold;">of</span>, <span style="font-weight:bold;">primitive</span>,
<span style="color:#006e28;">&gt;</span> <span style="font-weight:bold;">then</span>, <span style="font-weight:bold;">type</span>, <span style="font-weight:bold;">where</span>

infix operators

<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">quot</span>, <span style="color:#644a9b;">rem</span>, <span style="color:#644a9b;">div</span>, <span style="color:#644a9b;">mod</span>, <span style="color:#644a9b;">elem</span>, <span style="color:#644a9b;">notElem</span>, <span style="color:#644a9b;">seq</span>

this stuff is not handled yet

<span style="color:#006e28;">&gt;</span> !!, %, &amp;&amp;, $!, $, *, **, -,., /=, &lt;, &lt;=, =&lt;&lt;, ==, &gt;, &gt;=, &gt;&gt;, &gt;&gt;=, ^, ^^, ++, ||

functions

<span style="color:#006e28;">&gt;</span> <span style="color:#0057ae;">FilePath</span>, <span style="color:#0057ae;">IOError</span>, <span style="color:#644a9b;">abs</span>, <span style="color:#644a9b;">acos</span>, <span style="color:#644a9b;">acosh</span>, <span style="color:#644a9b;">all</span>, <span style="color:#644a9b;">and</span>, <span style="color:#644a9b;">any</span>, <span style="color:#644a9b;">appendFile</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">approxRational</span>, <span style="color:#644a9b;">asTypeOf</span>, <span style="color:#644a9b;">asin</span>, <span style="color:#644a9b;">asinh</span>, <span style="color:#644a9b;">atan</span>, <span style="color:#644a9b;">atan2</span>, <span style="color:#644a9b;">atanh</span>, <span style="color:#644a9b;">basicIORun</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">break</span>, <span style="color:#644a9b;">catch</span>, <span style="color:#644a9b;">ceiling</span>, <span style="color:#644a9b;">chr</span>, <span style="color:#644a9b;">compare</span>, <span style="color:#644a9b;">concat</span>, <span style="color:#644a9b;">concatMap</span>, <span style="color:#644a9b;">const</span>, <span style="color:#644a9b;">cos</span>, <span style="color:#644a9b;">cosh</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">curry</span>, <span style="color:#644a9b;">cycle</span>, <span style="color:#644a9b;">decodeFloat</span>, <span style="color:#644a9b;">denominator</span>, <span style="color:#644a9b;">digitToInt</span>, <span style="color:#644a9b;">div</span>, <span style="color:#644a9b;">divMod</span>, <span style="color:#644a9b;">drop</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">dropWhile</span>, <span style="color:#644a9b;">either</span>, <span style="color:#644a9b;">elem</span>, <span style="color:#644a9b;">encodeFloat</span>, <span style="color:#644a9b;">enumFrom</span>, <span style="color:#644a9b;">enumFromThen</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">enumFromThenTo</span>, <span style="color:#644a9b;">enumFromTo</span>, <span style="color:#644a9b;">error</span>, <span style="color:#644a9b;">even</span>, <span style="color:#644a9b;">exp</span>, <span style="color:#644a9b;">exponent</span>, <span style="color:#644a9b;">fail</span>, <span style="color:#644a9b;">filter</span>, <span style="color:#644a9b;">flip</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">floatDigits</span>, <span style="color:#644a9b;">floatRadix</span>, <span style="color:#644a9b;">floatRange</span>, <span style="color:#644a9b;">floor</span>, <span style="color:#644a9b;">fmap</span>, <span style="color:#644a9b;">foldl</span>, <span style="color:#644a9b;">foldl1</span>, <span style="color:#644a9b;">foldr</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">foldr1</span>, <span style="color:#644a9b;">fromDouble</span>, <span style="color:#644a9b;">fromEnum</span>, <span style="color:#644a9b;">fromInt</span>, <span style="color:#644a9b;">fromInteger</span>, <span style="color:#644a9b;">fromIntegral</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">fromRational</span>, <span style="color:#644a9b;">fst</span>, <span style="color:#644a9b;">gcd</span>, <span style="color:#644a9b;">getChar</span>, <span style="color:#644a9b;">getContents</span>, <span style="color:#644a9b;">getLine</span>, <span style="color:#644a9b;">head</span>, <span style="color:#644a9b;">id</span>, <span style="color:#644a9b;">inRange</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">index</span>, <span style="color:#644a9b;">init</span>, <span style="color:#644a9b;">intToDigit</span>, <span style="color:#644a9b;">interact</span>, <span style="color:#644a9b;">ioError</span>, <span style="color:#644a9b;">isAlpha</span>, <span style="color:#644a9b;">isAlphaNum</span>, <span style="color:#644a9b;">isAscii</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">isControl</span>, <span style="color:#644a9b;">isDenormalized</span>, <span style="color:#644a9b;">isDigit</span>, <span style="color:#644a9b;">isHexDigit</span>, <span style="color:#644a9b;">isIEEE</span>, <span style="color:#644a9b;">isInfinite</span>, <span style="color:#644a9b;">isLower</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">isNaN</span>, <span style="color:#644a9b;">isNegativeZero</span>, <span style="color:#644a9b;">isOctDigit</span>, <span style="color:#644a9b;">isPrint</span>, <span style="color:#644a9b;">isSpace</span>, <span style="color:#644a9b;">isUpper</span>, <span style="color:#644a9b;">iterate</span>, <span style="color:#644a9b;">last</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">lcm</span>, <span style="color:#644a9b;">length</span>, <span style="color:#644a9b;">lex</span>, <span style="color:#644a9b;">lexDigits</span>, <span style="color:#644a9b;">lexLitChar</span>, <span style="color:#644a9b;">lines</span>, <span style="color:#644a9b;">log</span>, <span style="color:#644a9b;">logBase</span>, <span style="color:#644a9b;">lookup</span>, <span style="color:#644a9b;">map</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">mapM</span>, <span style="color:#644a9b;">mapM_</span>, <span style="color:#644a9b;">max</span>, <span style="color:#644a9b;">maxBound</span>, <span style="color:#644a9b;">maximum</span>, <span style="color:#644a9b;">maybe</span>, <span style="color:#644a9b;">min</span>, <span style="color:#644a9b;">minBound</span>, <span style="color:#644a9b;">minimum</span>, <span style="color:#644a9b;">mod</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">negate</span>, <span style="color:#644a9b;">not</span>, <span style="color:#644a9b;">notElem</span>, <span style="color:#644a9b;">null</span>, <span style="color:#644a9b;">numerator</span>, <span style="color:#644a9b;">odd</span>, <span style="color:#644a9b;">or</span>, <span style="color:#644a9b;">ord</span>, <span style="color:#644a9b;">otherwise</span>, <span style="color:#644a9b;">pi</span>, <span style="color:#644a9b;">pred</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">primExitWith</span>, <span style="color:#644a9b;">print</span>, <span style="color:#644a9b;">product</span>, <span style="color:#644a9b;">properFraction</span>, <span style="color:#644a9b;">putChar</span>, <span style="color:#644a9b;">putStr</span>, <span style="color:#644a9b;">putStrLn</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">quot</span>, <span style="color:#644a9b;">quotRem</span>, <span style="color:#644a9b;">range</span>, <span style="color:#644a9b;">rangeSize</span>, <span style="color:#644a9b;">read</span>, <span style="color:#644a9b;">readDec</span>, <span style="color:#644a9b;">readFile</span>, <span style="color:#644a9b;">readFloat</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">readHex</span>, <span style="color:#644a9b;">readIO</span>, <span style="color:#644a9b;">readInt</span>, <span style="color:#644a9b;">readList</span>, <span style="color:#644a9b;">readLitChar</span>, <span style="color:#644a9b;">readLn</span>, <span style="color:#644a9b;">readOct</span>, <span style="color:#644a9b;">readParen</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">readSigned</span>, <span style="color:#644a9b;">reads</span>, <span style="color:#644a9b;">readsPrec</span>, <span style="color:#644a9b;">realToFrac</span>, <span style="color:#644a9b;">recip</span>, <span style="color:#644a9b;">rem</span>, <span style="color:#644a9b;">repeat</span>, <span style="color:#644a9b;">replicate</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">return</span>, <span style="color:#644a9b;">reverse</span>, <span style="color:#644a9b;">round</span>, <span style="color:#644a9b;">scaleFloat</span>, <span style="color:#644a9b;">scanl</span>, <span style="color:#644a9b;">scanl1</span>, <span style="color:#644a9b;">scanr</span>, <span style="color:#644a9b;">scanr1</span>, <span style="color:#644a9b;">seq</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">sequence</span>, <span style="color:#644a9b;">sequence_</span>, <span style="color:#644a9b;">show</span>, <span style="color:#644a9b;">showChar</span>, <span style="color:#644a9b;">showInt</span>, <span style="color:#644a9b;">showList</span>, <span style="color:#644a9b;">showLitChar</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">showParen</span>, <span style="color:#644a9b;">showSigned</span>, <span style="color:#644a9b;">showString</span>, <span style="color:#644a9b;">shows</span>, <span style="color:#644a9b;">showsPrec</span>, <span style="color:#644a9b;">significand</span>, <span style="color:#644a9b;">signum</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">sin</span>, <span style="color:#644a9b;">sinh</span>, <span style="color:#644a9b;">snd</span>, <span style="color:#644a9b;">span</span>, <span style="color:#644a9b;">splitAt</span>, <span style="color:#644a9b;">sqrt</span>, <span style="color:#644a9b;">subtract</span>, <span style="color:#644a9b;">succ</span>, <span style="color:#644a9b;">sum</span>, <span style="color:#644a9b;">tail</span>, <span style="color:#644a9b;">take</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">either</span>, <span style="color:#644a9b;">elem</span>, <span style="color:#644a9b;">encodeFloat</span>, <span style="color:#644a9b;">enumFrom</span>, <span style="color:#644a9b;">enumFromThen</span>, <span style="color:#644a9b;">enumFromThenTo</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">enumFromTo</span>, <span style="color:#644a9b;">error</span>, <span style="color:#644a9b;">even</span>, <span style="color:#644a9b;">exp</span>, <span style="color:#644a9b;">exponent</span>, <span style="color:#644a9b;">fail</span>, <span style="color:#644a9b;">filter</span>, <span style="color:#644a9b;">flip</span>, <span style="color:#644a9b;">floatDigits</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">floatRadix</span>, <span style="color:#644a9b;">floatRange</span>, <span style="color:#644a9b;">floor</span>, <span style="color:#644a9b;">fmap</span>, <span style="color:#644a9b;">takeWhile</span>, <span style="color:#644a9b;">tan</span>, <span style="color:#644a9b;">tanh</span>, <span style="color:#644a9b;">threadToIOResult</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">toEnum</span>, <span style="color:#644a9b;">toInt</span>, <span style="color:#644a9b;">toInteger</span>, <span style="color:#644a9b;">toLower</span>, <span style="color:#644a9b;">toRational</span>, <span style="color:#644a9b;">toUpper</span>, <span style="color:#644a9b;">truncate</span>, <span style="color:#644a9b;">uncurry</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">undefined</span>, <span style="color:#644a9b;">unlines</span>, <span style="color:#644a9b;">until</span>, <span style="color:#644a9b;">unwords</span>, <span style="color:#644a9b;">unzip</span>, <span style="color:#644a9b;">unzip3</span>, <span style="color:#644a9b;">userError</span>, <span style="color:#644a9b;">words</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#644a9b;">writeFile</span>, <span style="color:#644a9b;">zip</span>, <span style="color:#644a9b;">zip3</span>, <span style="color:#644a9b;">zipWith</span>, <span style="color:#644a9b;">zipWith3</span>

type constructors

<span style="color:#006e28;">&gt;</span> <span style="color:#0057ae;">Bool</span>, <span style="color:#0057ae;">Char</span>, <span style="color:#0057ae;">Double</span>, <span style="color:#0057ae;">Either</span>, <span style="color:#0057ae;">Float</span>, <span style="color:#0057ae;">IO</span>, <span style="color:#0057ae;">Integer</span>, <span style="color:#0057ae;">Int</span>, <span style="color:#0057ae;">Maybe</span>, <span style="color:#0057ae;">Ordering</span>, <span style="color:#0057ae;">Rational</span>, <span style="color:#0057ae;">Ratio</span>, <span style="color:#0057ae;">ReadS</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#0057ae;">ShowS</span>, <span style="color:#0057ae;">String</span>

classes

<span style="color:#006e28;">&gt;</span> <span style="color:#0057ae;">Bounded</span>, <span style="color:#0057ae;">Enum</span>, <span style="color:#0057ae;">Eq</span>, <span style="color:#0057ae;">Floating</span>, <span style="color:#0057ae;">Fractional</span>, <span style="color:#0057ae;">Functor</span>, <span style="color:#0057ae;">Integral</span>, <span style="color:#0057ae;">Ix</span>, <span style="color:#0057ae;">Monad</span>, <span style="color:#0057ae;">Num</span>, <span style="color:#0057ae;">Ord</span>, <span style="color:#0057ae;">Read</span>, <span style="color:#0057ae;">RealFloat</span>,
<span style="color:#006e28;">&gt;</span> <span style="color:#0057ae;">RealFrac</span>, <span style="color:#0057ae;">Real</span>, <span style="color:#0057ae;">Show</span>

data constructors

<span style="color:#006e28;">&gt;</span> <span style="color:#0057ae;">EQ</span>, <span style="color:#0057ae;">False</span>, <span style="color:#0057ae;">GT</span>, <span style="color:#0057ae;">Just</span>, <span style="color:#0057ae;">LT</span>, <span style="color:#0057ae;">Left</span>, <span style="color:#0057ae;">Nothing</span>, <span style="color:#0057ae;">Right</span>, <span style="color:#0057ae;">True</span>
</pre></body></html>
